home *** CD-ROM | disk | FTP | other *** search
/ Our Solar System / Our Solar System.iso / miscprog / targ / targ.c < prev    next >
Text File  |  1987-03-25  |  2KB  |  59 lines

  1. /* targ.c -- Main program for Targ-Hurt ESP Trainer.
  2.  
  3.    History: rhs 14-mar-87 ... Original
  4. */
  5.  
  6. #include <conio.h>
  7. #include "colors.h"
  8. #include "mancon.h"
  9. #include "declares.h"
  10.  
  11. main()
  12. {  IMPORT int gi_sound;
  13.    char sel;
  14.    breakkey(0);                        /* Disable break key and ctrl-c. */
  15.    
  16.    disp_crtmode();                     /* Set video mode that is appropriate
  17.                                           to video hardware. */
  18.    while((sel=menu())!='Q')
  19.       switch(sel)
  20.       {  case 'H': disp_help();
  21.                    break;
  22.          case 'C': mode_clairvoyance(); 
  23.                    break;
  24.          case 'P': mode_precognition(); 
  25.                    break;
  26.          case 'S': if(gi_sound==ON) gi_sound=OFF;
  27.                    else             gi_sound=ON;
  28.                    break;
  29.       }
  30.    border(BLACK);
  31.    clrscrn();
  32.    breakkey(1);                        /* Re-enable break key. */
  33. } /* end targ */
  34.  
  35.  
  36. char menu()
  37. {  IMPORT gi_fg1, gi_bg1;
  38.    char sel = 'x';
  39.    char *valid_sels = {"CHPQS"};
  40.  
  41.    disp_cls();  /* Clear the screen. */
  42.    disp_cursor(ON);
  43.  
  44.    colrprtf(1, gi_fg1, gi_bg1, "\n\n\nTarg-Hurt ESP Trainer\n");
  45.    colrprtf(1, gi_fg1, gi_bg1,
  46.       "Do you want to practice clairvoyance, or precognition?\n\n");
  47.    colrprtf(1, gi_fg1, gi_bg1,
  48.       "C)lairvoyance, P)recogniton, S)ound, H)ow-to-use-it, Q)uit\n");
  49.  
  50.    while(strchr(valid_sels, sel)==NULL)
  51.    {  colrprtf(1, gi_fg1, gi_bg1, "\n--->");
  52.       ecokey(&sel); 
  53.       sel=toupper(sel);
  54.    }
  55.    return(sel);
  56. } /* end menu() */
  57.  
  58.  
  59.